package com.javasm.controller.B2CController;

import com.javasm.common.http.AxiosResult;
import com.javasm.common.page.PageResult;
import com.javasm.controller.base.BaseController;
import com.javasm.domin.criteria.orderCriteria.OrderCriteria;
import com.javasm.domin.vo.orderVo.OrderAndReceiver;
import com.javasm.service.B2cOrderService.OrderService;
import lombok.RequiredArgsConstructor;
import org.ehcache.xml.BaseConfigParser;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import static com.javasm.common.dictionary.InitContext.dic;

/**
 * @Author：liyangsong
 * @Version：1.0
 * @Date：2021/11/25-10:25
 * @Since:jdk1.8
 * @Description:
 */

@RequestMapping("/orderOutStock")
@RestController
@RequiredArgsConstructor
public class OrderOutStockController extends BaseController {
    private final OrderService orderService;

    /**
     * 待出库的订单
     *
     * @param orderCriteria
     * @return
     */
    @RequestMapping("/page")
    public AxiosResult<PageResult<OrderAndReceiver>> find(OrderCriteria orderCriteria) {
        PageResult<OrderAndReceiver> result = null;
        ArrayList<Integer> integers = new ArrayList<>();
        integers.add(11);
        integers.add(1);
        integers.add(2);
        orderCriteria.setOrderStatusList(integers);
//        orderCriteria.setOrderStatus(11);
        result = orderService.search(orderCriteria);
        return AxiosResult.success(result);
    }
}
